package edu.buaa.framework.method2;
import java.io.*;
import java.util.Properties;
import java.nio.channels.Channel;
import sun.reflect.CallerSensitive;


public final class PlaybackSystem {

    public final static InputStream in = System.in;

    public final static PrintStream out = System.out;


    public final static PrintStream err = System.err;

    /** Don't let anyone instantiate this class */
    private PlaybackSystem() {
    }

    /* The security manager for the system.
     */
    private static volatile SecurityManager security = null;

    public static void setIn(InputStream in) {
        System.setIn(in);
    }


    public static void setOut(PrintStream out) {
        System.setOut(out);
    }


    public static void setErr(PrintStream err) {
        System.setErr(err);
    }

    public static Console console() {
       return System.console();
    }


    public static Channel inheritedChannel() throws IOException {
        return System.inheritedChannel();
    }


    public static
    void setSecurityManager(final SecurityManager s) {
        System.setSecurityManager(s);
    }



    public static SecurityManager getSecurityManager() {
        return System.getSecurityManager();
    }


    public static long currentTimeMillis(){
        System.out.println("currentTimeMillis");
        return System.currentTimeMillis();
    }


    public static long nanoTime(){
        return System.nanoTime();
    }


    public static void arraycopy(Object src,  int  srcPos,
                                        Object dest, int destPos,
                                        int length){
        System.arraycopy(src, srcPos, dest, destPos, length);
    }


    public static int identityHashCode(Object x){
        return identityHashCode(x);
    }


    public static Properties getProperties() {
        return System.getProperties();
    }


    public static String lineSeparator() {
        return System.lineSeparator();
    }


    public static void setProperties(Properties props) {
        System.setProperties(props);
    }


    public static String getProperty(String key) {
       return System.getProperty(key);
    }


    public static String getProperty(String key, String def) {
        return System.getProperty(key, def);
    }


    public static String setProperty(String key, String value) {

        return System.setProperty(key, value);
    }


    public static String clearProperty(String key) {

        return System.clearProperty(key);
    }



    public static String getenv(String name) {
        return System.getenv(name);
    }



    public static java.util.Map<String,String> getenv() {

        return System.getenv();
    }


    public static void exit(int status) {
        Runtime.getRuntime().exit(status);
    }


    public static void gc() {
        Runtime.getRuntime().gc();
    }


    public static void runFinalization() {
        Runtime.getRuntime().runFinalization();
    }


    @Deprecated
    public static void runFinalizersOnExit(boolean value) {
        Runtime.runFinalizersOnExit(value);
    }


    @CallerSensitive
    public static void load(String filename) {
        System.load(filename);
    }


    @CallerSensitive
    public static void loadLibrary(String libname) {
        System.loadLibrary(libname);
    }


    public static String mapLibraryName(String libname){
        return System.mapLibraryName(libname);
    }

}
